package fic.storefinder.server.utils;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import fic.storefinder.shared.utils.Constants;

public class PropertieReader {
	private static PropertieReader instance;
	
	private Properties properties;

	private PropertieReader() {
		try {
			properties = new Properties();
			properties.load (new FileInputStream (Constants.CONFIG_FILE_PATH));
		} catch (Exception e) {
			e.printStackTrace();
		} 
	}

	public static synchronized PropertieReader getInstance() {
		if (instance == null)
			instance = new PropertieReader();
		return instance;
	}
	
	public String getPropertieValueForKey(String key) {
		return properties.getProperty(key, "not found");
	}
}
